<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div></div>
    <script>
      //1.获取?参数
      var params = location.search;
      //2.直接使用最牛逼的方法
      //查询参数
      var p = new URLSearchParams(params);
      var uame = p.get('uname');
      document.querySelector('div').innerText = uname;
    </script>
  </body>
</html>
